<title>Thông Tin Sản Phẩm - Origami Shop | Origamishop.net</title>
<?php

	if (isset($_REQUEST["sp_id"]) == false)
	{
		header("location:index.php");
	}
	$id = $_REQUEST["sp_id"];
	$strSQL = "SELECT * FROM sp where sp_id=$id";
	$result = DataProvider::ExecuteQuery($strSQL);
	while($row1 = mysql_fetch_array($result))
	{
		$SQL = "update sp set sp_see=".($row1["sp_see"]+1)." where sp_id=$id";
		DataProvider::ExecuteQuery($SQL);
	}
			echo'
<div id="sfull">
	<div class="sf10px"></div>
    <div class="sftbd">
	<div class="divspla"></div>
	';
		$strSQL = "SELECT * FROM sp Inner Join ld ON ld.ld_nick = sp.sp_ld where sp_id = $id";
        $result = DataProvider::ExecuteQuery($strSQL);
        while($sp = mysql_fetch_array($result))
        {
			echo'
        <div class="sfp170">
            	<div class="sfpp"><a href="javascript:Music3(';
		echo "'";
		echo $sp["sp_imgt1"];
		echo"')";
		echo '"><img src="'.$sp["sp_t1"].'" width="168px" height="170px" border="0" quality="100"/></a></div>
                <div class="sf1px"></div>
				<div class="sf4px"></div>
                <div class="sfmain">
					<div class="sf35t"></div>
					<div class="sf100"><strong>Tên Sản Phẩm:</strong> <a href="'.$host["l_link"].'home.php?typ=product&act=detail&sp_id='.$sp["sp_id"].'">'.$sp["sp_ten"].'</a> ('.$sp["sp_tenjp"].')</div>
					<div class="sf50"><strong>Giá sản phẩm:</strong> '.$sp["sp_gia"].'đ</div>
					<div class="sf50"><strong>Giảm Giá:</strong> '.$sp["sp_sall"].'đ</div>
					<div class="sf50"><strong>Thời Gian Xếp:</strong> '.$sp["sp_time"].'</div>
					<div class="sf50"><strong>Người Xếp:</strong> <a href="'.$host["l_link"].'home.php?typ=product&act=viewld&ld_id='.$sp["ld_id"].'">'.$sp["ld_ten"].'</a></div>
					<div class="sf100"><strong>Kích Thước Mẫu:</strong> '.$sp["sp_size"].'</div>
					<div class="sf50"><strong>Lượng Tồn:</strong> '.$sp["sp_ton"].'</div>
					<div class="sf50"><strong>Lượt Bán:</strong> '.$sp["sp_count"].'</div>
					<div class="sf50"><strong>Lượt Xem:</strong> '.$sp["sp_see"].'</div>
					<div class="sf50"><strong>Loại Sản Phẩm:</strong> ';
	$strSQL1 = "SELECT * FROM sp Inner Join loaisp ON loaisp.loai_key = sp.sp_loai 
	where sp_id = $id";
	$result1 = DataProvider::ExecuteQuery($strSQL1);
	while($sp1 = mysql_fetch_array($result1))
	{
		echo $sp1["loai_ten"];
	}
					echo '</div>
				</div>
			<div class="sf1px"></div>
			<div class="sf50100">
				<div class="sfac"></div>
				<div class="sfull">
			';
		if($_SESSION["IsLogin"] == true)
		   {
			echo '<a href="home.php?typ=product&act=addcart&sp_id='.$sp["sp_id"].'" title="Thêm Vào Giỏ Hàng">';
		   }
		   else 
			{
			echo '<a href="home.php?typ=user&act=login">';
			}
			echo '
				<img class="add" src="'.$div["md_sty"].'cartadd.png" border="0" quality="100"/></a>
				</div>
			</div>
        </div>
		<div class="divspla"></div>
		<div class="divspdi"></div>
		<div class="divspla"></div>
    </div>
    <div class="sfhw"></div>
</div>
<div class="tctw" align="center">
	<div class="tct13x"></div>
	<div class="tct11x"><a href="javascript:Music3(';echo "'";echo $sp["sp_imgt2"];echo"')";echo '"><img src="'.$sp["sp_t2"].'" width="100px" height="100px" border="0" quality="10"/></a></div>
	<div class="tct1"></div>
	<div class="tct11x"><a href="javascript:Music3(';echo "'".$sp["sp_imgt3"]."')";echo '"><img src="'.$sp["sp_t3"].'" width="100px" height="100px" border="0" quality="10"/></a></div>
	<div class="tct1"></div>
	<div class="tct11x"><a href="javascript:Music3(';echo "'";echo $sp["sp_imgt4"];echo"')";echo '"><img src="'.$sp["sp_t4"].'" width="100px" height="100px" border="0" quality="10"/></a></div>
</div>
			';
		}
		echo '
		<div class="divspla"></div>
		<div class="divspdi"></div>
		<div class="divspla"></div>
		<div class="tct2x5"><strong>Sản Phẩm Cùng Loại</strong></div>
	<div class="tctw" align="center">
	<div class="tct1"></div>
';
	$result = DataProvider::ExecuteQuery($strSQL);
	$dong = mysql_fetch_array($result);
	$sql3 = "
	SELECT * FROM sp
	where sp_loai = '".$dong["sp_loai"]."' ORDER BY sp_see DESC limit 5";
	$result3 = DataProvider::ExecuteQuery($sql3);
	while($row3 = mysql_fetch_array($result3))
	{
		echo '
		<div class="tct11x"><a href="'.$host["l_link"].'home.php?typ=product&act=detail&sp_id='.$row3["sp_id"].'"><img src="'.$row3["sp_t1"].'" width="100" height="100%" border="0" /></a></div>
		<div class="tct1"></div>
		
		';
	}
	echo '
	</div>
		<div class="divspla"></div>
		<div class="divspdi"></div>
		<div class="divspla"></div>
		<div class="tct2x5""><strong>Sản Phẩm Cùng Người Xếp</strong></div>
	<div class="tctw" align="center">
	<div class="tct1"></div>
	';
	$result = DataProvider::ExecuteQuery($strSQL);
	$dong = mysql_fetch_array($result);
	$sql2 = "
	SELECT * FROM sp
	where sp_ld = '".$dong["sp_ld"]."' ORDER BY sp_see DESC
	limit 5
	";
	$result2 = DataProvider::ExecuteQuery($sql2);
	while($row2 = mysql_fetch_array($result2))
	{
		echo '
		<div class="tct11x"><a href="'.$host["l_link"].'home.php?typ=product&act=detail&sp_id='.$row2["sp_id"].'"><img src="'.$row2["sp_t1"].'" width="100" height="100%" border="0" /></a></div>
		<div class="tct1"></div>
		';
	}
	echo '
	</div>
		<div class="divspla"></div>
		<div class="divspdi"></div>
		<div class="divspla"></div>
	';
	
?>


